package com.icepuppet.controller;

import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletRequest;

@RestController
public class RequestController {

    //简单参数传输
    @RequestMapping("/simpleParam1")
    public String simpleParam(HttpServletRequest request) {
        String name = request.getParameter("name");
        String ageStr = request.getParameter("age");

        int age = Integer.parseInt(ageStr);
        System.out.println("simpleParam1:" + name + "今年" + age + "岁");
        return "OK";
    }

    @RequestMapping("/simpleParam2")
    public String simpleParamTest(String name,Integer age) {
        System.out.println("simpleParam2:" + name + "今年" + age + "岁");
        return "OK";
    }
}
